# -*- coding: utf-8 -*-
# @Author: Tim Liu
# @Date: 2024-05-27
# @Last Modified by: Tim Liu
# @Last Modified time: 2024-05-27

# @Description: Knowledge Base Params for RAG

from fastapi import Depends
from core.dependencies import Paging, QueryParams


class DocumentParams(QueryParams):
    """
    Pagination
    """

    def __init__(
            self,
            params: Paging = Depends(),
            is_active: bool = None,
            title: str = None,
            url: str = None,
            kbase_id: int = None
    ):
        super().__init__(params)
        self.v_order = "desc"
        self.v_order_field = "create_datetime"
        self.is_active = is_active
        self.kbase_id = kbase_id
        self.source_url = ("like", url)
        self.title = ("like", title)


class KnowledgeBaseParams(QueryParams):
    """
    Pagination
    """

    def __init__(
            self,
            params: Paging = Depends(),
            is_active: bool = None,
            description: str = None,
            name: str = None
    ):
        super().__init__(params)
        self.v_order = "desc"
        self.v_order_field = "create_datetime"
        self.is_active = is_active
        self.description = description
        self.name = ("like", name)
